473,434 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

How do I read and update DbaseIII files.

Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database,
and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb
databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great
Nov 20 '05 #1
3 5468
Hi,

It has been a while since I opened a dbase file. You do it the same
as with access but use this as the connection string
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= directory with dbase files;
Extended Properties=DBase III;". To open sample.dpf use this as your sql
statement. Select * from sample. Hope this helps.

Ken
-------------------
"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #2
I can import a dBase 5 table to a datatable in a dataset.
No idea if this works for older versions.

================================================== =========
strSQL = "SELECT * FROM [" & dBaseTableName & "]"
If strFileFormat = "dBase 5.0" Then
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath &
";Extended Properties=""dBase 5.0"""
End If

Dim obj As New DAL(strConn)
obj.FillTable(dsMain, strTableName, strSQL, "OLEDB")
================================================== =========
In my DAL (data access layer) I have a FillTable method:
================================================== =========
Public Sub FillTable(ByRef ds As DataSet, ByVal TableName As String, ByVal
strSQL As String, ByVal DBtype As String)
If DBtype = "SQL Server" Then
'do something
ElseIf DBtype = "Oracle" Then
'do something
ElseIf DBtype = "OLEDB" Then
Dim da As OleDbDataAdapter
Dim cnn As New OleDbConnection(mConnStr)
Dim cmd As New OleDbCommand(strSQL, cnn)
Try
cmd.CommandType = CommandType.Text
cnn.Open()
da = New OleDbDataAdapter(cmd)
da.Fill(ds, TableName)
Catch exc As Exception
Throw exc
Finally
cnn.Close()
End Try
End If
End Sub
================================================== =========
--
Joe Fallon

"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #3
Hi Frank,

You can access dbase files as datatables etc just as any other ado .net
object if you use the odbc provider for .net. If you have vs .net 2003 you
have it and need only set the correct import statements; if an earlier
version, you can download it and install it from msdn.microsoft.com.

HTH,

Bernie Yaeger

"Frank" <frank> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Hi, the problem I have is that an older dos program is using dbase 3 or 4
database files and I wish to add a little utility that scanns this database, and if specific record has a certain entry (flag) i wish to extract all of
the records for this entry change the flag in the dbase file and write it
into a new mdb database. The second part is no problem, i can hook into mdb databases and do all that stuff, but I cannot seem to create a proper
connection with a dbase file.

Problem: How do I set a connection corectly with a sample.dpf sample.ndx,
and read and write records into this dataset.

Any help would be great

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Yang Li Ke | last post by:
Hi guys! I have some datas that I must check everytime a visitor comes to my site What is better to do: 1- Read data from a file or 2- Read data from a mysql db Thank you
6
by: Maurice Mertens | last post by:
Hi, how can I open and read a DbaseIII file in .NET? -- Met vriendelijke groet / With regards / Saludos, Moviat Automatisering
1
by: David Gresser | last post by:
When I import a dbaseiii database into access, one of the fields which was a memo field in dbase now contains a wierd char that looks like an I with an accent over it followed by a box. This...
2
by: Jonny | last post by:
Hey all I'm looking for the fastest way to read/write/update/append xml files. Fairly complicated, large scale files It needs to be scalable, but very fast Any idea's Thanks
5
by: JenHu | last post by:
Hi experts, I wrote a function which retrieves a file in the folder, the file path is : Dim sr As New StreamReader(strFilepath & ReturnFileName) What if I have more than 1 file_name in...
1
by: eiji | last post by:
Hi folks, I'm new to binary-file handling and try to work/learn playing around with MD5. Now everything works fine with small files, but when files get bigger(e.g. 28MB) this loop stops in the...
35
by: RyanS09 | last post by:
Hello- I am trying to write a snippet which will open a text file with an integer on each line. I would like to read the last integer in the file. I am currently using: file = fopen("f.txt",...
2
by: jwt007 | last post by:
Hello everyone, I have a very specific need to detect rollbacks within a certain table in the database. To do this I am actively monitoring the transaction log with a small C++ program (using...
0
by: mukil | last post by:
Importing DbaseIII data to sql 2005 using asp Coding platform windows server 2003 awaitinf for reply regards, mukil
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.